Carbon


LocalToGlobal

Header: Quickdraw.h Carbon status: Supported

Converts a point’s coordinates from the local coordinates of the current graphics port (basic or color) to global coordinates.

void LocalToGlobal (
    Point *pt
);
Parameter descriptions
pt

A pointer to a point in local coordinates. On return, this point is converted to global coordinates.

DISCUSSION

The LocalToGlobal function converts the given point from the current graphics port’s local coordinate system into the global coordinate system (where the upper-left corner of the main screen has coordinates [0,0]). This global point can then be compared to other global points, or it can be changed into the local coordinates of another graphics port.

Because a rectangle is defined by two points, you can convert a rectangle into global coordinates with two calls to LocalToGlobal. In conjunction with LocalToGlobal, you can use the OffsetRect, OffsetRgn, or OffsetPoly functions to convert a rectangle, region, or polygon into global coordinates.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)